﻿using Iworld.Author.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace Iworld.Author.Service.Backstage.Export
{
    /// <summary>
    /// 充值卡记录
    /// </summary>
    [DataContract]
    public class RechargeCardRecordExport
    {
         /// <summary>
        /// 卡号
        /// </summary>
        [DataMember]
        public string Account { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [DataMember]
        public string Password { get; set; }

        ///<summary>
        /// 面值
        /// </summary>
        [DataMember]
        public double Golds { set; get; }

        /// <summary>
        /// 使用的时间
        /// </summary>
        [DataMember]
        public DateTime? UsedTime { get; set; }

        /// <summary>
        /// 生成人ID
        /// </summary>
        [DataMember]
        public int AdministratorId { set; get; }

         [DataMember]
        public AuthorExport UsedAuthor { set; get; }

         [DataMember]
         public DateTime CreatedTime { set; get; }

        public RechargeCardRecordExport(RechargeCard record)
        {
            this.Account = record.Account;
            this.Golds = record.Golds;
            this.UsedTime = record.UsedTime;
            this.Password = record.Password;
            this.AdministratorId = record.AdministratorId;
            if (record.UsedAuthor!=null)
            this.UsedAuthor = new AuthorExport(record.UsedAuthor);
            this.CreatedTime = record.CreatedTime;
        }
    }
}
